/**
 * 
 */
package com.nickstumpos.android.GmailWidgetPlus.labels;

/**
 * @author O254802
 * 
 */
public enum SystemLabels {
	LABEL_CHAT("^b", "Chat", true),
	LABEL_DRAFT("^r", "Drafts", true),
	LABEL_IGNORED("^g", "Ignored", true),
	LABEL_IMPORTANT_IMAP("^io_im", "Important", false),
	LABEL_INBOX("^i", "Inbox", false),
	LABEL_OUTBOX("^^out", "Outbox", true),
	LABEL_SENT("^f", "Sent", true),
	LABEL_SPAM("^s", "Spam", true),
	LABEL_STARRED("^t", "Stared", true),
	LABEL_TRASH("^k", "Trash", true),
	LABEL_VOICEMAIL("^vm", "Voice Mail", true),
	LABEL_VOICEMAIL_INBOX("^^vmi", "Voice Mail Inbox", true);

	public static SystemLabels systemLabelByCode(final String code) {

		SystemLabels ret = null;
		if (code != null) {
			for (final SystemLabels label : SystemLabels.values()) {
				if (label.getCode().equals(code)) {
					ret = label;
					break;
				}
			}
		}
		return ret;
	}

	private String	code;
	private String	name;
	private boolean	blacklistByDefault;

	/**
	 * @param code
	 * @param name
	 */
	private SystemLabels(final String code,
			final String name,
			final boolean blacklistByDefault) {

		this.code = code;
		this.name = name;
		this.blacklistByDefault = blacklistByDefault;
	}

	/**
	 * @return the code
	 */
	public String getCode() {

		return this.code;
	}

	/**
	 * @return the name
	 */
	public String getName() {

		return this.name;
	}

	/**
	 * @return the blacklistByDefault
	 */
	public boolean isBlacklistByDefault() {

		return this.blacklistByDefault;
	}
}
